﻿jQuery(document).ready(function () {

    $('#frProfilePersonalInfo').submit(function () {
        $('#msg-frProfilePersonalInfo').html('');
        App.blockUI($('#frProfilePersonalInfo'), false);
        $.ajax({
            type: "POST",
            url: "/Profile/EditPersonalInfo",
            data: $(this).serialize(),
            success: function (data) {
                $('#msg-frProfilePersonalInfo').html(data);
                App.unblockUI($('#frProfilePersonalInfo'));
            },
            error: function (xhr, ajaxOptions, thrownError) {
                $('#msg-frProfilePersonalInfo').html("Load failed");
                App.unblockUI($('#frProfilePersonalInfo'));
            }
        });
        return false;
    });
    $('#frChangePassword').submit(function () {
        $('#msg-AccountSetting').html('');
        App.blockUI($('#frChangPassword'), false);
        $.ajax({
            type: "POST",
            url: "/Profile/ChangePassword",
            data: $(this).serialize(),
            success: function (data) {
                $('#msg-AccountSetting').html(data);
                App.unblockUI($('#frChangPassword'));
            },
            error: function (xhr, ajaxOptions, thrownError) {
                $('#msg-AccountSetting').html("Load failed");
                App.unblockUI($('#frChangPassword'));
            }
        });
        return false;
    });



});